using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using HISModels.Entities;

namespace HISModels.Mapping
{
	public class sysdiagramMap : EntityTypeConfiguration<sysdiagram>
	{
		public sysdiagramMap()
		{
			// Primary Key
			this.HasKey(t => t.diagram_id);

			// Properties
			this.Property(t => t.name)
				.IsRequired()
				.HasMaxLength(128);
				
			// Table & Column Mappings
			this.ToTable("sysdiagrams");
			this.Property(t => t.name).HasColumnName("name");
			this.Property(t => t.principal_id).HasColumnName("principal_id");
			this.Property(t => t.diagram_id).HasColumnName("diagram_id");
			this.Property(t => t.version).HasColumnName("version");
			this.Property(t => t.definition).HasColumnName("definition");
		}
	}
}

